The present invention relates to the field of trajectory data storage. In various fields such as vehicle networking, intelligent transportation, and position-based services, the trajectory of a moving entity (e.g., a person or a vehicle) always needs to be recorded. For example, many devices such as vehicles, mobile phones, tablet computers, and personal digital assistants (PDA) have already been equipped with a global positioning system (GPS) or other navigation/positioning systems. When a vehicle or pedestrian travels along a particular route, the navigation/positioning system can continuously or periodically collect position data to form a trajectory.
Traditionally, position data of a plurality of positions on a trajectory are directly stored in a database. The stored data, for example, may comprise latitude/longitude and altitude coordinates of each position, the time when the entity passes the position, and the speed at which the entity passes the position. However, the volume of data that needs to be stored is tremendous. For example, in order to record trajectories of 1000 vehicles within one day, over 20 gigabytes of data needs to be stored every day, which is a huge burden on storage resources. Moreover, a user likely needs to query the stored trajectory data later. For example, the user likely wants to query a trajectory of a given entity within a particular period of time or the time of arrival at a particular position. However, the tremendous data size poses a great challenge for real-time query.